package com.dragon.repository.domain.dto;

import com.baomidou.mybatisplus.annotation.TableField;
import com.dragon.common.util.BeanUtils;
import com.dragon.repository.entity.PlanCollect;
import com.dragon.repository.entity.WorkflowJson;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;


/**
 * @author sy
 */
@Data
@JsonInclude(JsonInclude.Include.ALWAYS)
public class PlanCollectDTO {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "id")
    private Integer id;

    @ApiModelProperty(value = "合同id")
    private Integer contractId;

    @ApiModelProperty(value = "回款期数")
    private Integer num;

    @ApiModelProperty(value = "退款金额")
    private Double refundMoney;

    @ApiModelProperty(value = "计划回款金额")
    private Double planMoney;

    @ApiModelProperty(value = "计划回款方式：1银行卡 2微信 3支付宝")
    private Integer planType;

    @ApiModelProperty(value = "删除标识：0未删除 1已删除")
    private Integer deleted;

    @ApiModelProperty(value = "状态：0 待审核 1审核通过 2审核不通过 3作废 4删除")
    private Integer status;

    @ApiModelProperty(value = "计划回款日期")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date planTime;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    @ApiModelProperty(value = "负责人id（用户id）")
    private Integer adminId;

    @ApiModelProperty(value = "部门id")
    private Integer departmentId;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty("合同名称")
    private String tractName;

    @ApiModelProperty("客户名称")
    private String customerName;

    @ApiModelProperty("计划回款状态：0未完成 1已完成")
    private Integer planStatus;

    @ApiModelProperty(value = "实际回款金额")
    private Double actualPlanMoney;

    @ApiModelProperty(value = "单笔回款金额")
    private Double money;

    @ApiModelProperty(value = "计划回款类型：0普通回款，1：计划回款")
    private Integer planPayType;
    
    @ApiModelProperty(value = "回款账号")
    private String account;

    @ApiModelProperty(value = "工作流")
    private List<WorkflowJson> workflowJsonList;

    @ApiModelProperty(value = "平账金额")
    private Double balancingMoney;

    @ApiModelProperty(value = "账单状态：0未生成 1已生成")
    private Integer billStatus;

    @ApiModelProperty(value = "账单id")
    private Integer billId;

    @ApiModelProperty(value = "结算方式 1现结 2月结")
    private Integer settlementType;

    @ApiModelProperty(value = "在审金额")
    private Double auditMoney;

    @ApiModelProperty(value = "合同编码")
    private String contractCode;

    @ApiModelProperty(value = "收货状态")
    private Integer deliverStatus;

    @ApiModelProperty(value = "生产状态")
    private Integer type;

    @ApiModelProperty(value = "是否是建模合同：0否，1是")
    private Integer modeling;



    public PlanCollectDTO() {}

    public PlanCollectDTO(PlanCollect entity) {
        BeanUtils.copyProperties(entity,this);
    }

    public static PlanCollectDTO convert(PlanCollect entity) {
        return new PlanCollectDTO(entity);
    }

    public static List<PlanCollectDTO> convertList(List<PlanCollect> list) {
        List<PlanCollectDTO> resultList = new ArrayList<>();
        for (PlanCollect entity : list) {
            resultList.add(new PlanCollectDTO(entity));
        }
        return resultList;
    }}
